package service

import (
	"fmt"
	"github.com/e421083458/gorm"
	"micro-client/vender/article/model"
)

// 用户 - 查询客服
func GetConf(db *gorm.DB, key string, limit int) (data []model.Conf, err error) {
	// 查db
	where := ""
	if key != "" {
		where = fmt.Sprintf(" `key` = '%s'", key)
	}
	err = db.Model(&model.Conf{}).Where(where).Limit(limit).Scan(&data).Error
	if err != nil {
		return
	}
	return
}
